#include "stack.h"
#include <stdlib.h>
int main()
{
    DYMStack sta1;
    sta1 = DYMStackCreate(3);
    DYMStackPush(&sta1,'1');
    DYMStackPush(&sta1,'2');
    DYMStackPush(&sta1,'3');
    int flag = DYMStackPush(&sta1,'4');
    if(flag != 0)
    {
        printf("程序出错了！，进栈出错\n");
        exit(-1);
    }


    DYMStackDataType buff = 'k';
    DYMStackTop(&sta1,&buff);
    printf("%c ", buff);
    DYMStackPop(&sta1);

    DYMStackTop(&sta1,&buff);
    printf("%c ", buff);
    DYMStackPop(&sta1);

    DYMStackTop(&sta1,&buff);
    printf("%c ", buff);
    DYMStackPop(&sta1);

    flag = DYMStackTop(&sta1,&buff);
    if(flag != 0)
    {
        printf("程序出错了！，获取栈顶元素出错\n");
        exit(-1);
    }

    flag = DYMStackPop(&sta1);
    if(flag != 0)
    {
        printf("程序出错了！，元素出栈出错\n");
        exit(-1);
    }

    DYMStackDestory(sta1);
    printf("\n");
    return 0;
}